package com.mike.billingserver.vo;

import lombok.Data;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;

/**
 * @author xiaozefeng
 * @date 2018-12-20 15:25
 */
@Data
public class YearVO {

    private YearVO() {

    }

    private String name;

    private int value;

    public YearVO(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public static List<YearVO> generateYear() {
        int thisYear = LocalDate.now().getYear();
        return Arrays.asList(
                new YearVO("今年", thisYear),
                new YearVO("去年", thisYear - 1),
                new YearVO("前年", thisYear - 2));
    }
}

